//
//  NewsCell.m
//  GolfFriend
//
//  Created by Vescky on 14-5-2.
//  Copyright (c) 2014年 vescky.org. All rights reserved.
//

#import "NewsCell.h"
#import "UIImageView+MJWebCache.h"

@interface NewsCell ()

@end

@implementation NewsCell
@synthesize imgv;

- (void)setCellData:(NSDictionary*)_dict {
    if (isValidDictionary([_dict objectForKey:@"sourceLinks"]) && isValidArray([[_dict objectForKey:@"sourceLinks"] objectForKey:@"image"])) {
        NSString *imgLink = [[[_dict objectForKey:@"sourceLinks"] objectForKey:@"image"] firstObject];
        if ([imgLink stringByMatching:@"qiniudn.com"]) {
            imgLink = GetQiniuResizeImageLink(imgLink, 150);
        }
        [imgv setImageURLStr:imgLink placeholder:Default_Image_Normal];
    }
    
    labelContent.text = removeHtmlTags([_dict objectForKey:@"content"]);
    labelTitle.text = removeHtmlTags([_dict objectForKey:@"title"]);
}

@end
